/**
 * 
 */
package com.an.threadtest.procomu;

import java.util.UUID;

/**
 * @author Administrator
 * sheng生产请求的线程
 */
public class ProduceRequestThread extends Thread{

	/**
	 * 容器
	 */
	private final RequestContainer container;
	
	
	
	public ProduceRequestThread(RequestContainer container,String name) {
		super(name);
		this.container = container;
	}



	@Override
	public void run() {
		while(true) {
			try {
				Thread.sleep((long) (Math.random() * 1000));
				Request r = new Request("请求：" + UUID.randomUUID().toString() + ".制造者线程:" + getName());
				container.put(r);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
